Send expose events on foreign windows
authorAlexander Larsson <alexl@redhat.com>
Thu, 24 Sep 2009 14:42:52 +0000 (16:42 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 24 Sep 2009 14:48:04 +0000 (16:48 +0200)
F-Spot needs this as it draws on a foreign (screensaver) window, which
used to work.

I believe this is safe, because in all typical cases the expose
mask will not be set, so we won't do anything, and its what we used to
do.

gdk/gdkwindow.c

index 500bf6524d41da2c05d9bdfe07ec22c773ca3651..3231deac6dc5046d0b205dbc08bd6875b837a4fc 100644 (file)
@@ -5023,12 +5023,17 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
 
          g_object_unref (window);
        }
-      else if (private->bg_pixmap != GDK_NO_BG)
+      else if (private->bg_pixmap != GDK_NO_BG &&
+              private->window_type != GDK_WINDOW_FOREIGN)
        {
          /* No exposure mask set, so nothing will be drawn, the
           * app relies on the background being what it specified
           * for the window. So, we need to clear this manually.
           *
+          * For foreign windows if expose is not set that generally
+          * means some other client paints them, so don't clear
+          * there.
+          *
           * We use begin/end_paint around the clear so that we can
           * piggyback on the implicit paint */
 
@@ -5066,8 +5071,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
       GdkRegion *update_area = private->update_area;
       private->update_area = NULL;
 
-      if (_gdk_event_func && gdk_window_is_viewable (window)  &&
-         private->window_type != GDK_WINDOW_FOREIGN)
+      if (_gdk_event_func && gdk_window_is_viewable (window))
        {
          GdkRegion *expose_region;
          gboolean end_implicit;